package tmproject.hlhj.fhp.tmproject

import android.content.Context
import android.support.v4.view.PagerAdapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

/**
 * Created by Never Fear   on 2018\8\9 0009.
Never More....
 */
class PagerAdp(private val datas:ArrayList<String>,private val context:Context) :PagerAdapter() {
    override fun isViewFromObject(view: View, `object`: Any): Boolean {
        return view==`object`
    }

    override fun instantiateItem(container: ViewGroup, position: Int): Any {
        val inflate = LayoutInflater.from(context).inflate(R.layout.pager_item, null)
        container.addView(inflate)
        return inflate

    }

    override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
//        super.destroyItem(container, position, `object`)
    }
    override fun getCount(): Int {
        return datas.size
    }
}